<html>
     <head>
      <meta charset="utf-8">
 	 <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>QQ登录跳转</title>
        <script src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" type="text/javascript"></script>
        <script src="statics/libs/vue.min.js"></script>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="statics/css/bootstrap.min.css">
  <link rel="stylesheet" href="statics/css/font-awesome.min.css">
  <link rel="stylesheet" href="statics/css/AdminLTE.min.css">
  <link rel="stylesheet" href="statics/css/all-skins.min.css">
  <link rel="stylesheet" href="statics/css/main.css">

</head>
     
     <body>
           <p>页面跳转中。。。</p>
     <!-- 执行脚本 -->
     <script type="text/javascript">
     //应用的APPID
     var appID = "101031302";
     //初始构造请求
     if (window.location.hash.length == 0){
	    var redirectURI = "http://www.tgbbtt.com/rear-manage/bindQQ.html";
        var path = 'https://graph.qq.com/oauth2.0/authorize?';
        var queryParams = ['client_id=' + appID,
                           'redirect_uri=' + redirectURI,
                           'scope=' + 'get_user_info,list_album,upload_pic,add_feeds,do_like','response_type=token'];

        var query = queryParams.join('&');
        var url = path + query;
        window.location.href= url;
     } //在成功授权后回调时location.hash将带有access_token信息，开始获取openid
     else{
        //获取access token
        QC.Login.getMe(function(openId, accessToken){
        	bingQQ(openId);
        	
       });
     }
     </script>
     
     <script src="statics/libs/jquery.min.js"></script>
     <script type="text/javascript">
        function bingQQ(openid){
        	$.ajax({
				type: "GET",
				url: "/rear-manage/sys/login/bind/qq"+"?openid=" + openid,
			    dataType: "json",
			    success: function(result){
					if(result.code == 0){//登录成功
						alert("绑定成功");
						console.info("绑定成功");
						parent.location.href ='index.html';
					}else{
						vm.error = true;
						vm.errorMsg = result.msg;
						vm.refreshCode();
					}
				}
			});        
        }
        </script>
     </body>
</html>